package com.yiyuan.weixin.weixinInservice.action;

import com.yiyuan.weixin.model.Article;
import com.yiyuan.weixin.model.ReceiveXmlEntity;
import com.yiyuan.weixin.utils.HttpUtil;

/**
 * Created by happy on 2017/9/1.
 */
public class ActionSubscribe extends AbsWxAction {
    public  ReceiveXmlEntity actionSubscribe(ReceiveXmlEntity xmlEntity){
        //HttpUtil.sendGet("https://be.huobi.com/market/detail/merged?symbol=ethcny");
        return initReceiveXmlEntity(xmlEntity);
    }


    public ReceiveXmlEntity initReceiveXmlEntity(ReceiveXmlEntity receiveXmlEntity){

        Article article=new Article();
        article.setTitle("感谢订阅上海桐寅");
        article.setDescription("");
        article.setPicurl("http://image18-c.poco.cn/mypoco/myphoto/20170327/19/1735807212017032719150308.jpg");
        //article.setUrl("http://showhonglei.imwork.net/wsite/index.html");
        article.setUrl("");

        Article article1=new Article();
        article1.setTitle("注册或绑定数币网帐号");
        article1.setDescription("注册或绑定数币网帐号");
        article1.setPicurl("http://image18-c.poco.cn/mypoco/myphoto/20170327/19/1735807212017032719150308.jpg");
        //article.setUrl("http://showhonglei.imwork.net/wsite/index.html");
        article1.setUrl("http://shucoins.iok.la/wx_register.html?wechat="+receiveXmlEntity.getFromUserName());

//        Article article2=new Article();
//        article2.setTitle("绑定数币网帐号");
//        article2.setDescription("绑定数币网帐号");
//        article2.setPicurl("http://image18-c.poco.cn/mypoco/myphoto/20170327/19/1735807212017032719150308.jpg");
//        //article.setUrl("http://showhonglei.imwork.net/wsite/index.html");
//        article2.setUrl("http://shucoins.iok.la/wx_bind.html?openId="+receiveXmlEntity.getFromUserName());

        receiveXmlEntity.getArticles().add(article);
        receiveXmlEntity.getArticles().add(article1);
       // receiveXmlEntity.getArticles().add(article2);
        receiveXmlEntity.setArticleCount("2");
        return receiveXmlEntity;
    }
}
